package com.garrettch.memcache.util;

import net.rubyeye.xmemcached.MemcachedClient;
import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class XMemcachedClient {



    public static void main(String[] args) {
        MemcachedClient memcachedClient = null;
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application.xml");
        try

        {
            memcachedClient = (MemcachedClient) applicationContext.getBean("memcachedClient");
            memcachedClient.set("spring", 0, "3.0.0.RELEASE");
            System.out.println(memcachedClient.get("spring").toString());
            memcachedClient.replace("spring", 0, "4.0.0.RELEASE is coming");
        } catch (Exception e) {
        }
    }
}
